package torrentfile;

import java.io.File;
import java.util.ArrayList;

public class FileInfo {
	private String m_name;
	private long m_length;
	private String m_md5sum = null;	//Optional
	
	// Constructors	
	public FileInfo(ArrayList<String> name, long length) {
		super();
		setName(new String());
		for (int i=0; i<name.size(); i++)
			this.m_name.concat(File.separator + name.get(i));
		setLength(length);
	}

	public FileInfo(String name, long length) {
		super();
		setName(name);
		setLength(length);
	}

	public FileInfo(String name, long length, String md5sum) {
		super();
		setName(name);
		setLength(length);
		setMd5sum(md5sum);
	}
	
	// Accessors
	public String getName() {
		return m_name;
	}
	public void setName(String name) {
		this.m_name = name;
	}
	
	public long getLength() {
		return m_length;
	}
	public void setLength(long length) {
		this.m_length = length;
	}
	
	public String getMd5sum() {
		if (m_md5sum == null)
			m_md5sum = new String();
		return m_md5sum;
	}
	public void setMd5sum(String md5sum) {
		this.m_md5sum = md5sum;
	}
}
